Intro to Geospatial with R

…actually, with R but powered by Quarto

Author

Rafael Camargo

Published

December 6, 2022

Why R or Quarto ?

“If the only tool you have is a hammer, it is tempting to treat everything as if it were a nail” (Abraham Maslow, 1966)

  • The idea here is to add more tools to your toolbox

  • Some tasks can be done much more efficiently using one tool or the other

  • R is useful for much more stuff than statistical computing, e.g. for geospatial and for data science - from data mining, cleaning/wrangling, exploration, ML, to visualization

  • R was designed to handle tabular data (by the way, geospatial data is also tabular!)

  • RStudio IDE is ever evolving (and it’s free!), but what’s an IDE ?

  • Quarto is where you bring R, Python, and even Jupyter notebooks all together.

  • Quarto makes reproducible analysis easy, e.g. enables you to weave together content and executable code into a finished document (like this page, or a presentation, or pdf, or even a Shiny app)

Code
world <- rnaturalearth::ne_countries(scale = "medium", returnclass = "sf")
mapview::mapview(world, zcol = "pop_est")

 

Objective for this session

  • Show you how to setup your R / Quarto environment so that it’s ready to go when you need it

  • Show you some useful packages (libraries)

  • Show you some basic codes and some spatial stuff that R does nicely

  • Show you how to find the help you need

 

Let’s get started